<template>
	<view>
		<view class="main">
			<view class="main_type_one" v-if="type==0">
				<view class="loading"></view>
				<text>加载中</text>
			</view>
			<view class="main_type_one" v-if="type==1">{{endText}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "bottom-loading",
		props: {
			type: { //loading状态（0：加载中，1：加载结束）
				type: Number,
				default: 0
			},
			endText: { //loading结束文案
				type: String,
				default: "到底啦~"
			},
		},
		data() {
			return {

			};
		}
	}
</script>

<style scoped>
	.loading {
		position: relative;
		width: 10px;
		height: 10px;
		border: 2px solid #999;
		border-top-color: rgba(0, 0, 0, 0.2);
		border-right-color: rgba(0, 0, 0, 0.2);
		border-bottom-color: rgba(0, 0, 0, 0.2);
		border-radius: 100%;
		margin-top: 4rpx;
		animation: circle infinite 0.75s linear;
	}

	@keyframes circle {
		0% {
			transform: rotate(0);
		}

		100% {
			transform: rotate(360deg);
		}
	}

	.main {
		width: 100%;
		padding:20rpx 0 30rpx;
	}

	.main_type_one {
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		color: #999999;
	}

	.main_type_one text {
		margin-left: 20rpx;
	}
</style>